package ui.systems;

/*
 * An object of this class stores each move that a player makes and tells the board where to move to.
 */

public class MoveAction {

	MoveActionData data = new MoveActionData();

	public MoveAction(MoveActionData mv) {
		this(mv.fromRow, mv.fromCol, mv.toRow, mv.toCol);
	}
	
	public MoveAction(int r1, int c1, int r2, int c2) {
		data.fromRow = r1;
		data.fromCol = c1;
		data.toRow = r2;
		data.toCol = c2;

	}

	boolean isJump() {
		// Method tells is the move is a jump by checking if the distance moved
		// is equal to 2 squares.
		// The negative distance is for the opposite player.
		return (data.fromRow - data.toRow == 2 || data.fromRow - data.toRow == -2);

	}

}